home *** CD-ROM | disk | FTP | other *** search
/ PC Direct 1998 August / PC Direct August 1998.iso / S / powerj / Product / hpp.z / WPRTDLG.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1998-03-23  |  6.7 KB  |  208 lines

  1. /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2.    %     Copyright (C) 1994, by WATCOM International Inc.  All rights    %
  3.    %     reserved.  No part of this software may be reproduced or        %
  4.    %     used in any form or by any means - graphic, electronic or       %
  5.    %     mechanical, including photocopying, recording, taping or        %
  6.    %     information storage and retrieval systems - except with the     %
  7.    %     written permission of WATCOM International Inc.                 %
  8.    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  9. */
  10.  
  11. #ifndef _WPRTDLG_HPP_INCLUDED
  12. #define _WPRTDLG_HPP_INCLUDED
  13.  
  14. #ifndef _WNO_PRAGMA_PUSH
  15. #pragma pack(push,8);
  16. #pragma enum int;
  17. #endif
  18.  
  19. #ifndef _WCANVAS_HPP_INCLUDED
  20. #  include "wcanvas.hpp"
  21. #endif
  22. #ifndef _WCOMDLG_HPP_INCLUDED
  23. #  include "wcomdlg.hpp"
  24. #endif
  25. #ifndef _WPRTDATA_HPP_INCLUDED
  26. #  include "wprtdata.hpp"
  27. #endif
  28.  
  29. #undef GetPrinterData
  30. #undef SetPrinterData
  31. #if defined( _UNICODE )
  32. #define GetPrinterData GetPrinterDataW
  33. #define SetPrinterData SetPrinterDataW
  34. #else
  35. #define GetPrinterData GetPrinterDataA
  36. #define SetPrinterData SetPrinterDataA
  37. #endif
  38.  
  39. //
  40. // PrintDialog Styles
  41. //
  42.  
  43. typedef WULong WPrintDStyle;
  44.  
  45. #define WPrintDSAllPages                    ((WPrintDStyle)0x00000000L)
  46. #define WPrintDSSelection                   ((WPrintDStyle)0x00000001L)
  47. #define WPrintDSPageNums                    ((WPrintDStyle)0x00000002L)
  48. #define WPrintDSNoSelection                 ((WPrintDStyle)0x00000004L)
  49. #define WPrintDSNoPageNums                  ((WPrintDStyle)0x00000008L)
  50. #define WPrintDSCollate                     ((WPrintDStyle)0x00000010L)
  51. #define WPrintDSPrintToFile                 ((WPrintDStyle)0x00000020L)
  52. #define WPrintDSPrintSetup                  ((WPrintDStyle)0x00000040L)
  53. #define WPrintDSNoWarning                   ((WPrintDStyle)0x00000080L)
  54. #define WPrintDSReturnDC                    ((WPrintDStyle)0x00000100L)
  55. #define WPrintDSReturnIC                    ((WPrintDStyle)0x00000200L)
  56. #define WPrintDSReturnDefault               ((WPrintDStyle)0x00000400L)
  57. #define WPrintDSShowHelp                    ((WPrintDStyle)0x00000800L)
  58. #define WPrintDSEnablePrintHook             ((WPrintDStyle)0x00001000L)
  59. #define WPrintDSEnablePrintTemplate         ((WPrintDStyle)0x00004000L)
  60. #define WPrintDSUseDevModeCopies            ((WPrintDStyle)0x00040000L)
  61. #define WPrintDSUseDevModeCopiesAndCollate  ((WPrintDStyle)0x00040000L)
  62. #define WPrintDSDisablePrintToFile          ((WPrintDStyle)0x00080000L)
  63. #define WPrintDSHidePrintToFile             ((WPrintDStyle)0x00100000L)
  64. #define WPrintDSNoNetworkButton             ((WPrintDStyle)0x00200000L)
  65.  
  66. //
  67. // WPrintDialog
  68. //
  69. //    Used to display color dialog.
  70.  
  71. class WCMCLASS WPrintDialog : public WCommonDialog {
  72.     WDeclareSubclass( WPrintDialog, WCommonDialog );
  73.  
  74.     public:
  75.         WPrintDialog();
  76.  
  77.         ~WPrintDialog();
  78.  
  79.         /*******************************************************
  80.          * Properties
  81.          *******************************************************/
  82.  
  83.         // Copies
  84.  
  85.         WUShort GetCopies() const;
  86.         WBool   SetCopies( WUShort numCopies );
  87.  
  88.         // Collate
  89.         //
  90.         //
  91.         WBool   GetCollate() const;
  92.         WBool   SetCollate( WBool bCollate=FALSE);
  93.  
  94.         // FirstPage
  95.  
  96.         WUShort GetFirstPage() const;
  97.         WBool   SetFirstPage( WUShort firstPage );
  98.  
  99.         // FromPage
  100.  
  101.         WUShort GetFromPage() const;
  102.         WBool   SetFromPage( WUShort fromPage );
  103.  
  104.         // InfoCanvas
  105.  
  106.         WInfoCanvas GetInfoCanvas() const;
  107.  
  108.         // LastPage
  109.  
  110.         WUShort GetLastPage() const;
  111.         WBool   SetLastPage( WUShort lastPage );
  112.  
  113.         // PrinterData
  114.         //
  115.         //    The data that defines which printer is chosen and
  116.         //    its currennt settings (landscape, etc.).  A copy is made
  117.         //    when setting.
  118.  
  119.         WPrinterData GetPrinterData() const;
  120.         WBool        SetPrinterData( const WPrinterData & pd );
  121.  
  122.         // PrinterCanvas
  123.  
  124.         WPrinterCanvas GetPrinterCanvas() const;
  125.         
  126.         // SoftwareCollate
  127.         //
  128.         //    This property is TRUE if the application software
  129.         //    should perform the collation (the printer does not
  130.         //    support collating, so it must be emulated in software)
  131.         
  132.         WBool GetSoftwareCollate() const;
  133.         
  134.         // SoftwareCopies
  135.         //
  136.         //    This property returns the number of copies that the
  137.         //    application software should print.  It will be '1' if
  138.         //    the printer supports the collating / copies selected,
  139.         //    otherwise it will be the number of copies that the
  140.         //    application software must print.  In all cases, the
  141.         //    number entered by the user in the dialog is available
  142.         //    through GetCopies(), and the number of copies that should
  143.         //    be printed by your code is in GetSoftwareCopies().
  144.         
  145.         WUInt GetSoftwareCopies() const;
  146.  
  147.         // Style
  148.         //
  149.         //    Set the styles used by the print dialog.  Note that
  150.         //    the WPrintDSEnableHook style will ALWAYS be enabled.
  151.  
  152.         WPrintDStyle GetStyle() const;
  153.         WBool        SetStyle( WPrintDStyle style );
  154.  
  155.         // ToPage
  156.  
  157.         WUShort GetToPage() const;
  158.         WBool   SetToPage( WUShort toPage );
  159.  
  160.         /*******************************************************
  161.          * Methods
  162.          *******************************************************/
  163.  
  164.         // ChangeStyle
  165.         //
  166.         //    Use to turn a specific style on or off.
  167.  
  168.         WBool ChangeStyle( WPrintDStyle style, WBool on );
  169.  
  170.         // Prompt
  171.         //
  172.         //    Display the dialog and wait for it to be dismissed.
  173.         //    The first form uses the current settings.  The second
  174.         //    is a convenience function.
  175.  
  176.         WBool Prompt();
  177.  
  178.         WBool Prompt( WWindow *owner, const WChar *title );
  179.  
  180.         /************************************************************
  181.          * Notifications
  182.          ************************************************************/
  183.  
  184.         void OnDialogInitialize( WWindowHandle hWnd, WWindowHandle focus );
  185.  
  186.     protected:
  187.  
  188.         virtual void  *PackPD();
  189.         virtual WBool  UnpackPD( WBool ok );
  190.  
  191.     protected:
  192.  
  193.         void           *_pd;
  194.         WBool           _softwareCollate;
  195.         WUInt           _softwareCopies;
  196.         WPrinterCanvas  _printerCanvas;
  197.         WInfoCanvas     _infoCanvas;
  198.         WPrinterData    _printerData;
  199. };
  200.  
  201.  
  202. #ifndef _WNO_PRAGMA_PUSH
  203. #pragma enum pop;
  204. #pragma pack(pop);
  205. #endif
  206.  
  207. #endif // _WPRTDLG_HPP_INCLUDED
  208.